package com.cluster;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * Created with IntelliJ IDEA by ChouFy on 2020-04-12.
 *
 * @author zhoufy
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    /**
     * 拦截器配置
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册自定义拦截器，添加拦截路径和排除拦截路径
        // 添加拦截器

        registry.addInterceptor(new ApiInterceptor()).addPathPatterns("/**").excludePathPatterns("/login/**","/error");

        super.addInterceptors(registry);
    }


}
